import java.nio.file.Path;
import java.io.File;
import java.lang.String;

import Algo.Algo;
/*	this algorithm return tags according to the file size*/
public class SizeAlgo implements Algo{
	public String [] tagFile(Path child){
		String tags[]={"size"};
		File file = new File(child.toString());
	    if (!file.exists() || !file.isFile()) {
	      System.out.println("File doesn\'t exist");
	      return null;
	    }
	    if (file.length()>1000000)
	    	tags[0]="enormous";
	    else if (file.length()>10000)
	    	tags[0]="big";
	    else if (file.length()>100)
	    	tags[0]="medium";
	    else
	    	tags[0]="small";	    
	    //Here we get the actual size	
		return tags;
	}
	public String descript(){	
		return "this algorithm return tags according to the file size";
	}
	public String toString(){
		return "SizeAlgo";
	}
}

